<template>
   <div class="header-action">
                        <ul>
                            <li class="header-phone" v-if="usphone">
                                <div class="icon"><i class="flaticon-telephone"></i></div>
                                <a :href="`tel:${usphone}`"><span>电话联系我们</span>{{ usphone }}</a>
                            </li>
                            <li class="header-user"><router-link :to="isLogin ?customerpage: register" :title="isLogin ? '进入个人主页':'登录或注册'"><i class="flaticon-user"></i></router-link></li>
                            <li class="header-wishlist" v-if="isLogin">
                                <router-link to="/favorite"><i class="flaticon-heart-shape-outline"></i></router-link>
                                <span class="item-count">76</span>
                            </li>
                            <li class="header-cart-action" v-if="isLogin">
                                <div class="header-cart-wrap">
                                    <a href="cart.html"><i class="flaticon-shopping-basket"></i></a>
                                    <span class="item-count">2</span>
                                    <ul class="minicart">
                                        <li class="d-flex align-items-start">
                                            <div class="cart-img">
                                                <a href="shop-details.html"><img src="img/product/cart_p01.jpg" alt=""></a>
                                            </div>
                                            <div class="cart-content">
                                                <h4><a href="shop-details.html">Organic Farm Fresh Nuts</a></h4>
                                                <div class="cart-price">
                                                    <span class="new">$229.9</span>
                                                    <span><del>$229.9</del></span>
                                                </div>
                                            </div>
                                            <div class="del-icon">
                                                <a href="javascript:;"><i class="far fa-trash-alt"></i></a>
                                            </div>
                                        </li>
                                        <li class="d-flex align-items-start">
                                            <div class="cart-img">
                                                <a href="shop-details.html"><img src="img/product/cart_p02.jpg" alt=""></a>
                                            </div>
                                            <div class="cart-content">
                                                <h4><a href="shop-details.html">Organic Fresh Nuts Vanla Butter</a></h4>
                                                <div class="cart-price">
                                                    <span class="new">$229.9</span>
                                                    <span><del>$229.9</del></span>
                                                </div>
                                            </div>
                                            <div class="del-icon">
                                                <a href="javascript:;"><i class="far fa-trash-alt"></i></a>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="total-price">
                                                <span class="f-left">Total:</span>
                                                <span class="f-right">$239.9</span>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="checkout-link">
                                                <router-link to="/cart">Shopping Cart</router-link>
                                                <router-link class="black-color" to="/checkout">Checkout</router-link>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <div class="cart-amount">$0.00</div>
                            </li>
                        </ul>
                    </div>
</template>

<script>
import { getusphone } from '@/api/head';
import { mapState ,mapGetters} from 'vuex';


export default {
        
      data() {
        return {
            usphone:null,
            customerpage:'/customer',
            register:'/register'
        }
      },
      computed:{
        ...mapState({
            customer:state=>state.customer.customer,
            account:state=>state.customer.account,

        }),
        ...mapGetters('customer',['isLogin'])
      },
      created() {
        getusphone().then(phone=>{
            this.usphone=phone
        })
      },
}
</script>

<style>

</style>